import { unLock, waitFor } from "@nodejs/redis";
export abstract class Loginer {
    constructor(public readonly reqId: string, public readonly clientId: string) { }
    async qrcode(): Promise<string> {
        return await waitFor(this.reqId)
    }
    async ack() {
        await unLock(this.reqId)
    }
    abstract start(): Promise<void>;

    async run(): Promise<string> {
        this.start()
        return this.qrcode()
    }
}